package com.lg.dborder2.controller;


import com.lg.dborder2.model.Country;
import com.lg.dborder2.service.CountryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class HelloController {

    private final CountryService countryService;

    public HelloController(CountryService countryService) {
        log.info("HelloController...");
        this.countryService = countryService;
    }

    @PostMapping(value = "hello")
    public String hello(){
        List<Country> countryList =  countryService.findAll();
        log.info(countryList.toString());
        return "hello";
    }
}
